
#INT_AD
void ad_isr(void)
{
    ad_ch[ad_cn_ch]=read_adc(ADC_READ_ONLY);
    if (ad_cn_ch < MAX_CH - 1) {
        ad_cn_ch++;
        set_adc_channel(ad_cn_ch);
        read_adc(adc_start_only);
    } else {
        ad_cn_ch=0;
        ad_ok=1;
        /*
                set ad_ok flag to notify main loop that, ad readings are done
                start new read sequece in 
                tmr3 interrupt handler
              */
        set_adc_channel(ad_cn_ch);
    }
    return;
}
